package demo.hadoop.tsdb;

/**
 * metric 及 tags，用于方便将metric和tag组合在一起
 * 
 * <h1>Metrics and Tags</h1> The following rules apply to metric and tag values:
 * 
 * <li>Strings are case sensitive, i.e. "Sys.Cpu.User" will be stored separately
 * from "sys.cpu.user"
 * <li>Spaces are not allowed
 * <li>Only the following characters are allowed: a to z, A to Z, 0 to 9, -, _,
 * ., / or Unicode letters (as per the specification)
 * <p>
 * Metric and tags are not limited in length, though you should try to keep the
 * values fairly short.
 *
 */
public class MetricTags {

    /** mainstay 异常补偿统计 */
    public enum LOG_COUNT_MAINSTAY {
        metric("log_count_mainstay"),
        /** 应用名 */
        app("app"),
        /**
         * 依赖的API，如：com.ximalaya.fans.business.api.thrift.handler.IFansServiceHandler$Iface:isFollowingByIds
         */
        c_api("c-api"),
        /** API 接口， 如：/rtb/task/addInBatch */
        api("api");

        private final String str;

        public String getStr() {
            return str;
        }

        private LOG_COUNT_MAINSTAY(String str) {
            this.str = str;
        }

    }

    /** 异常补偿统计 */
    public enum LOG_COUNT_SAMPLE {
        metric("log_count_sample"),
        /** 应用名 */
        app("app"),
        /** 主机名 */
        host("host"),
        /** api 接口， 如：/rtb/task/addInBatch */
        api("api"),
        /**
         * 报错的代码行，如：com.ximalaya.mainstay.rpc.proxy.RpcInvocationHandler:handleInvocation:71
         */
        log_type("log_type");

        private final String str;

        public String getStr() {
            return str;
        }

        private LOG_COUNT_SAMPLE(String str) {
            this.str = str;
        }

    }

    /** 异常统计 */
    public enum EXCEPTION_COUNT {
        metric("exception_count"),
        /** 应用名 */
        app("app"),
        /** 等级，如：ERROR */
        level("level"),
        /** 主机名 */
        host("host"),
        /** api 接口， 如：/rtb/task/addInBatch */
        api("api"),
        /**
         * 报错的代码行，如：com.ximalaya.mainstay.rpc.proxy.RpcInvocationHandler:handleInvocation:71
         */
        log_type("log_type"),
        /** 错误日志分类，有：mainstay */
        log_classify_type("log_classify_type");

        private final String str;

        public String getStr() {
            return str;
        }

        private EXCEPTION_COUNT(String str) {
            this.str = str;
        }

    }
}
